import service from "@/utils/request"
import SynchronizationLoginNork from '@/utils/SynchronizationLoginWork'
import Synchronization from "@/utils/Synchronization"
export interface PackingMaterialsInStorage{
    total: number,
    list: list[]
}

export interface list{
    mtlNo: string,
    mtlColor: null,
    mtlName: string,
    mtlSpec: string,
    mtlUnit: string,
    inDate: string,
    outDate: string,
    inQty: number,
    outQty: number,
    stockQty: number
}

export interface PackingMaterialsOutOfStorageParameters{
    category:string,
    inStockEndDate:string,
    inStockStartDate:string,
    lotNo:string,
    mtlName:string,
    mtlNo:string,
    mtlSpec:string,
    outStockEndDate:string,
    outStockStartDate:string,
    pageNum:number,
    pageSize:number,
    stock:string
}

// 包材入库
export const PackingMaterialsInStorageDate = (PackingMaterialsInStorage:PackingMaterialsOutOfStorageParameters) => {
    return Synchronization.post<any,PackingMaterialsInStorage>('/pack/getPcPackStock',PackingMaterialsInStorage)
}

export interface PackageMaterialStorageQuery{
    mtlNo: string,
    mtlColor: null,
    mtlName: string
}

// 包材入库 查询条件返回
export const  PackageMaterialStorageQueryConditionReturned = () => {
    return Synchronization.get<any,PackageMaterialStorageQuery[]>('/pack/getPcPackStockCondition')
}

export interface OutboundAndInboundParameters{
    mtlNo:string,
    mtlName:string
}

export interface outIntInterface{
    in: {
        total: null | number,
        list: list[]
        },
    out: {
        total: null | number,
        list: list[]
        }
}

export interface list {
    lotNo: string,
    vendor: string,
    slipDate: number ,
    slipNo: string,
    slipReason: null,
    qty: number
}

// 入库 出库 表格
export const OutIntTableDate = (parms:OutboundAndInboundParameters) => {
    return Synchronization.get<any,outIntInterface>('/pack/getPcPackStockInOut',{
        params:{mtlNo:parms.mtlNo,mtlName:parms.mtlName}
    })
}